<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ include file="/WEB-INF/share/taglib.jsp"%>
<!DOCTYPE html>
<html>
<head>
<title>用户详情</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<%@ include file="/WEB-INF/share/easyuilist.jsp"%>
<script type="text/javascript">
	    var keyValue = request('id');
	    var instanceId = "";
	    var formId = "";
	    $(function () {
	    	var data = [];
			$('#wxopenid').find('li').each(function(){
				var o = new Object();
				o.value = $(this).attr('data-value');
				o.text = $(this).html();
				data.push(o);
			})
			
			$("#wxopenid").ComboBox({
				id:'value',
				text:'text',
				description : "==请选择==",
				isuse : true,
				height:'200px',
				allowSearch:true,
				data:data
			})

			var wxopenid = '${agentuser.wxopenid}';
			if (wxopenid) $('#wxopenid').ComboBoxSetValue(wxopenid);
	    })
	    //保存表单
	    function AcceptClick() {
	        if (!$('#form1').Validform()) {
	            return false;
	        }
	        var postData = $("#form1").GetWebControls(keyValue);
	        postData["id"] = keyValue;
	        $.SaveForm({
	            url: "${ctx}/agentuser/save",
	            param: postData,
	            loading: "正在保存数据...",
	            success: function (data) {
	                $.currentIframe().$("#gridTable").trigger("reloadGrid");
	            }
	        })
	    }
	</script>
</head>
<body>
	<form id="form1">
		<input id="id" value="${agentuser.id}" type="hidden" /> <input id="isuse"
			value="${agentuser.isuse}" type="hidden" />
		<div style="margin-left: 10px; margin-right: 10px;">
			<div id="BaseInfo" class="tab-pane active"
				style="padding-right: 30px;">
				<table class="form">
					<tr>
						<td class="formTitle">代理<font face="宋体">*</font></td>
						<td class="formValue">
							<div id="wxopenid" type="select" class="ui-select ui-underline" isvalid="yes" checkexpession="NotNull">
								<ul>
									<c:forEach items="${userList}" var="entry">
										<li data-value="${entry.openid}">${entry.nickname}</li>
									</c:forEach>
								</ul>
							</div>
						</td>
					</tr>
					<tr>
						<td class="formTitle">账户<font face="宋体">*</font></td>
						<td class="formValue"><input id="account"
							value="${agentuser.account}" type="text"
							onblur="$.ExistField(this.id,'${ctx}/user/ExistAccount')"
							class="form-control" placeholder="请输入账户" isvalid="yes"
							checkexpession="NotNull" /></td>
					</tr>
					<c:if test="${empty agentuser.id}">
						<tr>
							<td class="formTitle">密码<font face="宋体">*</font></td>
							<td class="formValue"><input id="password"
								value="${agentuser.password}" type="password" class="form-control"
								placeholder="请输入密码" isvalid="yes" checkexpession="NotNull" /></td>
						</tr>
					</c:if>
					<tr>
						<td class="formTitle">姓名</td>
						<td class="formValue"><input id="username"
							value="${agentuser.username}" type="text" class="form-control"
							placeholder="请输入姓名" /></td>
					</tr>
					<tr>
						<td class="formTitle">手机号码</td>
						<td class="formValue"><input id="tel" value="${agentuser.tel}"
							type="text" class="form-control" placeholder="请输入手机号码" /></td>
					</tr>
					<tr>
						<th class="formTitle" valign="top" style="padding-top: 4px;">备注
						</th>
						<td class="formValue"><textarea id="remark"
								class="form-control" style="height: 50px;">${agentuser.remark}</textarea>
						</td>
					</tr>
				</table>
			</div>
		</div>
	</form>
</body>
</html>
